<template>


   <div class="common-layout">
    <el-container>
      <el-aside width="200px">

         <el-scrollbar>
        <el-menu :default-openeds="['1', '5']">     
          <img src="@/assets/logo.png">
          
            <el-sub-menu index="1">
            <template #title>
              <el-icon ><Stopwatch /></el-icon>仪表盘
            </template>
            </el-sub-menu>

          
          <el-sub-menu index="2">                              
            <template #title>
              <el-icon><Menu /></el-icon>常用设置
            </template>
            <el-menu-item-group>
              
              <el-menu-item index="2-1"  @click="BookAn">教师管理</el-menu-item>
              <el-menu-item index="2-2" @click="BookBn">学生管理</el-menu-item>
               <el-menu-item index="2-3" @click="BookCn">公告管理</el-menu-item>
              <el-menu-item index="2-4" @click="BookDn">系统配置</el-menu-item>
               <el-menu-item index="2-5" @click="BookEn">判题服务器</el-menu-item>
            </el-menu-item-group>
           
          </el-sub-menu>

          <el-sub-menu index="3">
            <template #title>
              <el-icon><Aim /></el-icon>问题
            </template>
            <el-menu-item-group>
              
              <el-menu-item index="3-1" @click="BookFn" >问题列表</el-menu-item>
              <el-menu-item index="3-2" @click="BookGn" >增加题目</el-menu-item>
               <el-menu-item index="3-2" @click="BookHn" >导入导出题目</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          
            
           <el-sub-menu index="4">
            <template #title>
              <el-icon><Trophy /></el-icon>比赛练习
            </template>
            <el-menu-item-group>
             
              <el-menu-item index="4-1" @click="BookIn" >比赛列表</el-menu-item>
              <el-menu-item index="4-2" @click="BookJn" >创建比赛</el-menu-item>
            </el-menu-item-group> 
          </el-sub-menu>

          <el-sub-menu index="5">
            <template #title>
              <el-icon><Tickets /></el-icon>课程
            </template>
            <el-menu-item-group>
             
              <el-menu-item index="5-1"  @click="BookKn">课程列表</el-menu-item>
              <el-menu-item index="5-2"  @click="BookLn">创建课程</el-menu-item>
            </el-menu-item-group> 
          </el-sub-menu>

        </el-menu>
      </el-scrollbar>


      </el-aside>

      <el-container>
        <el-header>
          <el-dropdown>
      
        <el-icon><Search /></el-icon>
        <el-icon><Share /></el-icon>
        username<el-icon><arrow-down /></el-icon>
      
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item>logout</el-dropdown-item>
          
        </el-dropdown-menu>
      </template>
    </el-dropdown>

        </el-header>
       <el-main>
         
         <!-- <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>Card name</span>
       
      </div>
    </template>
    <div style="">主体内容</div>
  </el-card>-->
<router-view></router-view>
        </el-main>

         <el-footer >
          
            Build Version:20210929bd
        </el-footer>

      </el-container>

    </el-container>
  </div>
</template>



<script>
import {Stopwatch,Menu,Aim,Trophy,Tickets,Search,Share,ArrowDown} from '@element-plus/icons-vue'        //从UI库内图标中获取到图标信息
export default {
  components:{
    Stopwatch,         //定义使用的图标组件
    Menu,
    Aim,
    Trophy,
     Tickets,
     Search,
     Share,
     ArrowDown
       
      
  },
  methods:{
    BookAn(){
      this.$router.push('/bookan')                           //点击跳转路由，显示当前跳转后的页面该页面就是path的路由路径
    },
    BookBn(){
      this.$router.push('/bookbn')
    },
    BookCn(){
      this.$router.push('/bookcn')
    },
    BookDn(){
      this.$router.push('/bookdn')
    },
    BookEn(){
      this.$router.push('/booken')
    },
    BookFn(){
       this.$router.push('/bookfn')
    },
     BookGn(){
       this.$router.push('/bookgn')
    },
     BookHn(){
       this.$router.push('/bookhn')
    },
     BookIn(){
       this.$router.push('/bookin')
    },
     BookJn(){
       this.$router.push('/bookjn')
    },
     BookKn(){
       this.$router.push('/bookkn')
    },
     BookLn(){
       this.$router.push('/bookln')
    },
  }

}
</script>


<style >

.el-header{
     background-color:#F9FAFC;
    color:var(--el-text-color-primary);
    text-align: right;
    
}
.el-aside{
      background-color: #d3dce6;
      text-align:center;
      line-height: 200px;

}
.el-main{
     background-color: #e9eef3;
      text-align:center;
}
.el-footer{
   background-color: #b3c0d1;
    color:var(--el-text-color-primary);
    text-align:center;
    line-height: 20px;
}

</style>
